//
//  BaseViewController.m
//  HTP
//
//  Created by admin on 15/10/26.
//  Copyright © 2015年 nit. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view setBackgroundColor:[UIColor whiteColor]];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
//TODO:MBProgress 动画加载
-(void)showMbProgress:(NSString *)text{
    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    hud.mode = MBProgressHUDModeIndeterminate;
    hud.labelText = text;
}
-(void)hiddenMbProgress{
    [MBProgressHUD hideHUDForView:self.view animated:YES];
}
//TODO:SVProgress 动画加载
-(void)showSvprogress:(NSString *)text{
    [SVProgressHUD setBackgroundColor:RGBCOLOR(0, 0, 0, 0.6)];
    [SVProgressHUD setForegroundColor:[UIColor whiteColor]];
    [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeClear];
    [SVProgressHUD showWithStatus:text];
}
-(void)showSVProgressSuccess:(NSString *)text{
    [SVProgressHUD setBackgroundColor:RGBCOLOR(0, 0, 0, 0.6)];
    [SVProgressHUD setForegroundColor:[UIColor whiteColor]];
    [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeClear];
    [SVProgressHUD showSuccessWithStatus:text];
}
-(void)showSVProgressFailed:(NSString *)text{
    [SVProgressHUD setBackgroundColor:RGBCOLOR(0, 0, 0, 0.6)];
    [SVProgressHUD setForegroundColor:[UIColor whiteColor]];
    [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeClear];
    [SVProgressHUD showErrorWithStatus:text];
}
-(void)dismissSVProgress{
    [SVProgressHUD dismiss];
}
-(UILabel *)getNormolLabel{
    UILabel *label = [[UILabel alloc] init];
    label.textAlignment = _TEXT_ALIGN_CENTER;
    label.font = [UIFont systemFontOfSize:15];
    label.textColor = RGBCOLOR(0, 0, 0, 0.7);
    label.numberOfLines = 0;
    return label;
}
-(void)backToQM{
    if (!self.navigationController) {
        return;
    }
    [self.navigationController popViewControllerAnimated:YES];
}
-(void)addCustomBackBase{
    [self addCustomBackWithAction:@selector(backToQM) normalImg:SYSTEMBACKIMAGE selectImg:SYSTEMBACKIMAGE withPadding:5];
}
-(void)setNavTitle:(NSString *)title{
    [self addCustomTitleWithTitle:title];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
